<div id="pad-wrapper" class="new-user">
	<div class="row-fluid header">
		<h3>社团编辑</h3>
	</div>
	<div class="row-fluid form-wrapper">
		<!-- left column -->
		<div class="span9 with-sidebar">
			<div class="container">
				<form class="new_user_form form-horizontal" action="/organization/save" method="post" id="dataForm" enctype="multipart/form-data">
				<input type="hidden" name="id" value="<?php echo $row['id']?>" />		
				<div class="field-box"></div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="organization_name">社团名称：</label>
				  <div class="controls col-lg-5">
					<input type="text" id="organization_name" name="organization_name" placeholder="社团名称" data-bv-notempty="" data-bv-notempty-message="验证码不能为空" value="<?php echo $row['organization_name']?>" />
					</div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="description">社团描述：</label>
				  <div class="controls col-lg-5">
					<textarea type="text" class="span6" rows="5" id="description" name="description" placeholder="社团描述"><?php echo $row['description']?></textarea>
				  </div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="icon">社团头像：</label>
				  <div class="controls col-lg-5">
					<?php if($row['icon']):?><img src="<?php echo STATIC_IMAGE . $row['icon']?>" style="max-width:200px;max-height:200px"><br/><?php endif;?>
					<input type="file" accept="image/*" id="icon" name="icon"/>
				  </div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="proprieter_name">社长姓名：</label>
				  <div class="controls col-lg-5">
					<input type="text" id="proprieter_name" name="proprieter_name" placeholder="社长姓名" value="<?php echo $row['proprieter_name']?>"/>
				  </div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="proprieter_desc">社长介绍：</label>
				  <div class="controls col-lg-5">
					<textarea type="text" class="span6" rows="5" id="proprieter_desc" name="proprieter_desc" placeholder="社长介绍"><?php echo $row['proprieter_desc']?></textarea>
				  </div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="proprieter_icon">社长头像：</label>
				  <div class="controls col-lg-5">
					<?php if($row['proprieter_icon']):?><img src="<?php echo STATIC_IMAGE . $row['proprieter_icon']?>" style="max-width:200px;max-height:200px"><br/><?php endif;?>
					<input type="file" accept="image/*" id="proprieter_icon" name="proprieter_icon"/>
				  </div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="public">社团公告：</label>
				  <div class="controls col-lg-5">
					<textarea type="text" class="span6" rows="5" id="public" name="public" placeholder="社团公告"><?php echo $row['public']?></textarea>
				  </div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="t_sort">排序：</label>
				  <div class="controls col-lg-5">
					<input type="number" class="span1" id="t_sort" name="t_sort" placeholder="排序" min="1" value="<?php echo $row['t_sort']?>"/>
				  </div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="join_qrcode">社团入群二维码：</label>
				  <div class="controls col-lg-5">
					<?php if($row['join_qrcode']):?><img src="<?php echo STATIC_IMAGE . $row['join_qrcode']?>" style="max-width:300px"><br/><?php endif;?>
					<input type="file" accept="image/*" id="join_qrcode" name="join_qrcode"/>
				  </div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="template_image">发送模版图：</label>
				  <div class="controls col-lg-5">
					<?php if($row['template_image']):?><img src="<?php echo STATIC_IMAGE . $row['template_image']?>" style="max-width:300px"><br/><?php endif;?>
					<input type="file" accept="image/*" id="template_image" name="template_image"/>
				  </div>
				</div>
				<div class="control-group form-group span12">
				  <label class="control-label" for="status">状态：</label>
				  <div class="controls col-lg-5">
					<div class="ui-select span1">
					  <select name="status">
						<option value="1" <?php if($row['status'] == 1) echo 'selected'?>>使用</option>
						<option value="2" <?php if($row['status'] == 2) echo 'selected'?>>禁用</option>
					  </select>
					  <span class="help-block">Please correct the error</span>
					</div>
				  </div>
				</div>
				<div class="span12 field-box"></div>
				<div class="control-group form-group span12 actions">
				  <label class="control-label"></label>
				  <div class="controls col-lg-5">
					<input type="submit" class="btn-glow primary" value="提交" />
				  </div>
				</div>
				</form>
			</div>
		</div>
		<!-- side right column -->
		<div class="span3 form-sidebar pull-right">
		</div>
	</div>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#dataForm').bootstrapValidator({
			message: 'This value is not valid',
			feedbackIcons: {
				valid: 'glyphicon glyphicon-ok',
				invalid: 'glyphicon glyphicon-remove',
				validating: 'glyphicon glyphicon-refresh'
			},
			fields: {
				organization_name: {
					message: '社团名称不符合规则',
					validators: {
						notEmpty: {
							message: '社团名称是必填项，不能为空'
						}
					}
				},
				description: {
					message: '社团描述不符合规则',
					validators: {
						notEmpty: {
							message: '社团描述是必填项，不能为空'
						}
					}
				},
				proprieter_name: {
					message: '社长姓名不符合规则',
					validators: {
						notEmpty: {
							message: '社长姓名是必填项，不能为空'
						}
					}
				},
				proprieter_desc: {
					message: '社长介绍不符合规则',
					validators: {
						notEmpty: {
							message: '社长介绍是必填项，不能为空'
						}
					}
				},
				public: {
					message: '社团公告不符合规则',
					validators: {
						notEmpty: {
							message: '社团公告是必填项，不能为空'
						}
					}
				},
				t_sort: {
					message: '排序不符合规则',
					validators: {
						notEmpty: {
							message: '排序是必填项，不能为空'
						}
					}
				}
			}
		});
	});
	</script>
</div>